<!doctype html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>bootstrap-quicktab演示</title>
    <link rel="stylesheet" href="../vendor/bootstrap-icons/font/bootstrap-icons.css">
    <link rel="stylesheet" href="../vendor/bootstrap/dist/css/bootstrap.min.css">
</head>
<body>

<div class="container p-2">
    <button class="btn btn-success"
            onclick="parent.Quicktab.get('.qtab1').addTab({title:'新页面',url:'welcome.html?a=2'})">添加tab(.qtab1)
    </button>
    <button class="btn btn-success"
            onclick="parent.Quicktab.get('.qtab2').addTab({title:'新页面',url:'welcome.html?a=4'})">添加tab(.qtab2)
    </button>
    <button class="btn btn-success btn1">添加tab(.qtab2)</button>
</div>

<script src="../vendor/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="../vendor/jquery/dist/jquery.min.js"></script>
<script>
    $(function () {
        $('.btn1').on('click', function () {
            var num = Math.round(Math.random() * (100000 - 1) + 1);
            parent.Quicktab.get('.qtab2').addTab({
                //标题
                title: "首页" + num,
                //连接
                url: 'welcome.html?randow=' + num,
                //是否可以关闭
                close: true,
            })
        })
    })
</script>
</body>
</html>